'use strict';

const Sequelize = require('sequelize');
const config = require('../../config/database');

const sequelize = new Sequelize(
    config.database,
    config.username,
    config.password,
    config.options
);
// 测试连接
sequelize.authenticate()
    .then(() => {
        // console.log('Connection has been established successfully.');
    })
    .catch((err) => {
        console.error('Unable to connect to the database:', err);
    });
sequelize.sync()
module.exports = sequelize;
